<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
</head>
<body>
<div th:fragment="tableBlock" class="widget-content">
    <div class="table-responsive">
        <table id="datatable" class="table table-striped data-table table-bordered" width="100%">
        <thead>
        <tr>
            <th class="table-head" id="permissionName">权限名称</th>
            <th class="table-head" id="url">权限url</th>
            <th class="table-head" id="type">权限等级</th>
            <th class="table-head" id="sort">权限顺序</th>
            <th class="table-head" id="parentGuid">父级权限</th>
            <th class="table-head" id="img">图标</th>
            <th class="table-head">操作</th>
        </tr>
        </thead>

        <tbody>
        <tr  th:each="permission : ${formBean.list}">
            <td class="table-content" th:text="${permission.permissionName}"></td>
            <td class="table-content" th:text="${permission.url}"></td>
            <td class="table-content">
                <div th:switch="${permission.type}">
                    <p th:case="1" style="background-color: #003f81">一级菜单</p>
                    <p th:case="2" style="background-color: #3d773d">二级菜单</p>
                    <p th:case="9" style="background-color: #5eb95e">按钮权限</p>
                </div>
            </td>
            <td class="table-content" th:text="${permission.sort}"></td>
            <td class="table-content" >
                <p th:each="pParent:${selectList}" th:if="${pParent.guid} == ${permission.parentGuid}" th:text="${pParent.permissionName}"/>
            </td>
            <td class="table-content" th:text="${permission.img}"></td>
                <td>
                <div class="td-operate">
                    <a href="#" th:onclick="'javascript:editInfo(\'resources\',\''+${permission.guid}+'\');'" class="td-edit">编辑</a>
                    <a href="#" th:onclick="'javascript:delConfirm(\'resources\',\''+${permission.guid}+'\');'" class="td-del">删除</a>
                </div>
            </td>
        </tr>

        </tbody>

    </table>
    </div>
</div>

</body>
</html>